<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The EvWatcher class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evtimer.set.html">EvTimer::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evwatcher.clear.html">EvWatcher::clear</a></div>
 <div class="up"><a href="book.ev.html">Ev</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.evwatcher" class="reference">
 <h1 class="title">The EvWatcher class</h1>
 
 <div class="partintro"><p class="verinfo">(PECL ev &gt;= 0.2.0)</p>

  <div class="section" id="evwatcher.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">EvWatcher</strong>
    is a base class for all watchers(
    <a href="class.evcheck.html" class="classname">EvCheck</a>
    ,
    <a href="class.evchild.html" class="classname">EvChild</a>
    etc.). Since
    <strong class="classname">EvWatcher</strong>
    &#039;s constructor is
    <span class="modifier">abstract</span>
    , one can&#039;t(and don&#039;t need to) create EvWatcher objects
    directly.
   </p>
  </div>

  <div class="section" id="evwatcher.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">abstract</span>
      <strong class="classname">EvWatcher</strong>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.html#evwatcher.props.is-active">$<var class="varname">is_active</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.html#evwatcher.props.data">$<var class="varname">data</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.html#evwatcher.props.is-pending">$<var class="varname">is_pending</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.evwatcher.html#evwatcher.props.priority">$<var class="varname">priority</var></a></var>
    ;</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">int</span>
   <span class="methodname"><a href="evwatcher.clear.html" class="methodname">clear</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span>
   <span class="modifier">public</span>
   <span class="methodname"><a href="evwatcher.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="evwatcher.feed.html" class="methodname">feed</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$revents</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">EvLoop</span>
   <span class="methodname"><a href="evwatcher.getloop.html" class="methodname">getLoop</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="evwatcher.invoke.html" class="methodname">invoke</a></span>
    ( <span class="methodparam">
    <span class="type">int</span>
     <code class="parameter">$revents</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">bool</span>
   <span class="methodname"><a href="evwatcher.keepalive.html" class="methodname">keepalive</a></span>
    ([ <span class="methodparam">
    <span class="type">bool</span>
     <code class="parameter">$value</code>
   </span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="evwatcher.setcallback.html" class="methodname">setCallback</a></span>
    ( <span class="methodparam">
    <span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span>
     <code class="parameter">$callback</code>
   </span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="evwatcher.start.html" class="methodname">start</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type">void</span>
   <span class="methodname"><a href="evwatcher.stop.html" class="methodname">stop</a></span>
    ( <span class="methodparam">void</span>
   )</div>

   }</div>

  </div>

  <div class="section" id="evwatcher.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="evwatcher.props.is-active">
      <var class="varname"><var class="varname">is_active</var></var>
     </dt>

     <dd>

      <p class="para">
       <em class="emphasis">Readonly</em>
       . <strong><code>TRUE</code></strong> if the watcher is active. <strong><code>FALSE</code></strong> otherwise.
      </p>
     </dd>

    
    
     <dt id="evwatcher.props.data">
      <var class="varname"><var class="varname">data</var></var>
     </dt>

     <dd>

      <p class="para">
       User custom data associated with the watcher
      </p>
     </dd>

    
    
     <dt id="evwatcher.props.is-pending">
      <var class="varname"><var class="varname">is_pending</var></var>
     </dt>

     <dd>

      <p class="para">
       <em class="emphasis">Readonly</em>
       .<strong><code>TRUE</code></strong> if the watcher is pending, i.e. it has outstanding events, but
       its callback has not yet been invoked. <strong><code>FALSE</code></strong> otherwise. As long, as a
       watcher is pending(but not active), one must
       <em class="emphasis">not</em>
       change its priority.
      </p>
     </dd>

    
    
     <dt id="evwatcher.props.priority">
      <var class="varname"><var class="varname">priority</var></var>
     </dt>

     <dd>

      <p class="para">
       <span class="type"><a href="language.types.integer.html" class="type Integer">Integer</a></span>
       between
       <strong><code>Ev::MINPRI</code></strong>
       and
       <strong><code>Ev::MAXPRI</code></strong>
       . Pending watchers with higher priority will be invoked before watchers
       with lower priority, but priority will not keep watchers from being
       executed(except for
       <a href="class.evidle.html" class="classname">EvIdle</a>
       watchers).
       <a href="class.evidle.html" class="classname">EvIdle</a>
       watchers provide functionality to suppress invocation when higher
       priority events are pending.
      </p>
     </dd>

    
   </dl>

  </div>

 </div>

 














































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="evwatcher.clear.html">EvWatcher::clear</a> — Clear watcher pending status</li><li><a href="evwatcher.construct.html">EvWatcher::__construct</a> — Abstract constructor of a watcher object</li><li><a href="evwatcher.feed.html">EvWatcher::feed</a> — Feeds the given revents set into the event loop</li><li><a href="evwatcher.getloop.html">EvWatcher::getLoop</a> — Returns the loop responsible for the watcher</li><li><a href="evwatcher.invoke.html">EvWatcher::invoke</a> — Invokes the watcher callback with the given received events bit
  mask</li><li><a href="evwatcher.keepalive.html">EvWatcher::keepalive</a> — Configures whether to keep the loop from returning</li><li><a href="evwatcher.setcallback.html">EvWatcher::setCallback</a> — Sets new callback for the watcher</li><li><a href="evwatcher.start.html">EvWatcher::start</a> — Starts the watcher</li><li><a href="evwatcher.stop.html">EvWatcher::stop</a> — Stops the watcher</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="evtimer.set.html">EvTimer::set</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="evwatcher.clear.html">EvWatcher::clear</a></div>
 <div class="up"><a href="book.ev.html">Ev</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
